package rpg.visual.menu.item;

import java.awt.event.MouseEvent;

import pgui.PVisual;
import pgui.visual.PImage;
import rpg.visual.menu.VisualMenuItem;
import rpg.visual.window.VisualWindowStatus;

public class VisualMenuStatus extends VisualMenuItem {
	private VisualWindowStatus window;

	public VisualMenuStatus(PVisual visual) {
		super(visual, "My Status", new PImage());
		getImage().loadImage("./data/icons/menu/status.png");
		setWindow(new VisualWindowStatus(visual));
	}

	// Mouse Events
	@Override
	public void onMouseReleased(MouseEvent event) {
		super.onMouseReleased(event);
		
		if(getVisual().getMainComponent().containChild(window))
			getVisual().getMainComponent().removeChild(window);
		else getVisual().getMainComponent().addChild(window);
	}

	// Get & Set
	public VisualWindowStatus getWindow() {
		return window;
	}

	public void setWindow(VisualWindowStatus window) {
		this.window = window;
	}
}
